<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Extends Option  扩展选项</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <script type="text/javascript" src="../assets/js/vue.js"></script>
    </head>
    <body>
        <h1>Extends Option  扩展选项</h1>
        <hr>
        <div id="app">
            ${num}
            <p><button @click="add">ADD</button></p>
        </div>
        <script type="text/javascript">
           var extendsobj={
               updated:function(){
                console.log('我是扩展的updated'); 
               },
               methods:{
                add:function(){//方法名和vue原生的相同时，只执行原生的方法
                        console.log('我是扩展出来的方法');
                        this.num++
                    } 
               }
           }
           var app = new Vue({
                el: '#app',
                data: {
                    num: 1
                },
                methods:{
                    add:function(){
                        console.log('我是原生的方法');
                        this.num++
                    }
                },
                updated:function(){
                    console.log('我是原生的updated');
                },
                extends:extendsobj,
                delimiters:['${','}']//改变插值形式
            })
        </script>
    </body>
</html>